<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-95 {
                text-align: right;
            }

            .col-5 {
                text-align: left;
            }

            .col-80 {
            }

            .col-20 {
                width: 5%;
            }
        </style>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }
        </script>

    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <p:growl id="msgs" showDetail="false"/>
            <h:form>
                <p:panel header="接口消息路由状态">
                    <br/>
                   <p:fieldset>
                        <h:panelGrid id="detailPanel" columns="2" cellpadding="8" border="0" width="100%">
                            <h:panelGrid columns="4" columnClasses="col-label,col-input,col-label,col-input" width="80%">

                                <h:outputLabel value="银行名称："/>
                                <h:selectOneMenu value="#{biRouteLogAction.bankCode}" style="width: 206px;">
                                    <f:selectItems value="#{biRouteLogAction.bankCodeList}"/>
                                </h:selectOneMenu>

                                <h:outputLabel value="数据接口："/>
                                <h:selectOneMenu value="#{biRouteLogAction.opCode}" style="width: 206px;">
                                    <f:selectItems value="#{biRouteLogAction.tradeCodeList}"/>
                                </h:selectOneMenu>

                                <h:outputLabel value="*起始时间："/>
                                <p:inputMask mask="9999-99-99" value="#{biRouteLogAction.startDate}"
                                             style="width:198px;" onfocus="this.select();" required="true"
                                             requiredMessage="必须输入起始时间！"/>

                                <h:outputLabel value="*截止时间："/>
                                <p:inputMask mask="9999-99-99" value="#{biRouteLogAction.endDate}"
                                             style="width:198px;" required="true"
                                             requiredMessage="必须输入截止时间！"/>

                                </h:panelGrid>
                            <h:panelGrid style="text-align: left">
                                <p:commandButton id="qryBtn" update="pdt,msgs,dtbl_ft" ajax="true"
                                                 style="margin-left:10px;margin-top:1px;margin-bottom:1px;width=50px;" value="查询"
                                                 action="#{biRouteLogAction.qryLogList}"/>

                                </h:panelGrid>
                        </h:panelGrid>
                    </p:fieldset>

                    <p:ajaxStatus style="height:20px;text-align:center">
                        <f:facet name="start">
                            <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                        </f:facet>
                        <f:facet name="complete">
                            <h:outputText value=""/>
                        </f:facet>
                    </p:ajaxStatus>
                    <p:fieldset id="dtbl_ft" legend="#{biRouteLogAction.bankMap[biRouteLogAction.bankCode]}#{biRouteLogAction.opCode}接口消息路由状态表"
                                toggleable="true" toggleSpeed="500">
                        <br/>
                        <p:dataTable id="pdt" style="width:100%;"
                                     dynamic="true" selectionMode="single"
                                     value="#{biRouteLogAction.logList}" var="record"
                                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     paginator="true" rows="10" paginatorPosition="bottom"
                                     rowsPerPageTemplate="100,50,30,10,5"
                                     emptyMessage="数据记录为空...">

                            <p:column headerText="消息ID" style="text-align:left">
                                <h:outputText value="#{record.msgId}"/>
                            </p:column>
                            <p:column headerText="消息起点" style="text-align:left">
                                <h:outputText value="#{biRouteLogAction.appMap[record.msgFrom]}"/>
                            </p:column>
                            <p:column headerText="消息终点" style="text-align:left">
                                <h:outputText value="#{biRouteLogAction.appMap[record.msgTo]}"/>
                            </p:column>
                            <p:column headerText="当前位置" style="text-align:left">
                                <h:outputText value="#{biRouteLogAction.appMap[record.currentAddr]}"/>
                            </p:column>
                            <p:column headerText="是否送达" style="text-align:center">
                                <h:outputText value="#{biRouteLogAction.boolType.valueOfAlias(record.isArrive).title}"/>
                            </p:column>
                            <p:column headerText="消息关联ID" style="text-align:left">
                                <h:outputText value="#{record.corralationId}"/>
                            </p:column>
                            <p:column headerText="消息类型" style="text-align:left">
                                <h:outputText value="#{record.msgType}"/>
                            </p:column>
                            <p:column headerText="返回码" style="text-align:left">
                                <h:outputText value="#{record.msgRtncode}"/>
                            </p:column>
                            <p:column headerText="闸口状态" style="text-align:left">
                                <h:outputText value="#{biRouteLogAction.downMap[record.downStatus]}"/>
                            </p:column>
                            <p:column headerText="记录时间" style="text-align:center">
                                <h:outputText value="#{record.logdate}">
                                        <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="GMT+8"/>
                                </h:outputText>
                            </p:column>


                        </p:dataTable>

                    </p:fieldset>
                </p:panel>
            </h:form>
        </div>
    </ui:define>

</ui:composition>